﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:sys="clr-namespace:System;assembly=mscorlib" 
                   xmlns:res="clr-namespace:PCSWpfClient.Resources"
                    xmlns:cmd="clr-namespace:PCSWpfClient.Commands">

    <ResourceDictionary.MergedDictionaries>
        <ResourceDictionary Source="Styles.xaml" />
    </ResourceDictionary.MergedDictionaries>
    
    <DataTemplate x:Key="InstrumentTemplate">
        <StackPanel>
            <TextBlock Text="{Binding Path=Name}" />
            <CheckBox IsChecked="{Binding Path=Special}" IsEnabled="False"/>
        </StackPanel>
    </DataTemplate>

    <DataTemplate x:Key="InactiveInstrumentTemplate">
        <Border BorderBrush="Black" Margin="2" BorderThickness="2">
        <StackPanel>
                <TextBlock Text="{Binding Path=Name}" Style="{StaticResource InactiveTextBlockStyle}"/>
                <CheckBox IsChecked="{Binding Path=Special}" IsEnabled="False"/>
        </StackPanel>
        </Border>
    </DataTemplate>

    <Style x:Key="alternatingWithTriggers" TargetType="{x:Type ListBoxItem}">
        <Setter Property="Background" Value="Blue"/>
        <Setter Property="Foreground" Value="White"/>
        <Style.Triggers>
            <Trigger Property="ListBox.AlternationIndex" Value="1">
                <Setter Property="Background" Value="CornflowerBlue"/>
                <Setter Property="Foreground" Value="Black"/>
            </Trigger>
            <Trigger Property="ListBox.AlternationIndex" Value="2">
                <Setter Property="Background" Value="LightBlue"/>
                <Setter Property="Foreground" Value="Navy"/>
            </Trigger>
        </Style.Triggers>
    </Style>



    <cmd:InstrumentDataTemplateSelector x:Key="InstrumentTemplateSelector"/>
    <cmd:BooleanToSelectedItemConverter x:Key="BooleanToSelectedItemConverter"/>


    <ObjectDataProvider MethodName="GetValues"
                        ObjectType="{x:Type sys:Enum}"
                        x:Key="InstrumentTypeValues">
        <ObjectDataProvider.MethodParameters>
            <x:Type TypeName="res:InstrumentType" />
        </ObjectDataProvider.MethodParameters>
    </ObjectDataProvider>
</ResourceDictionary>